import request from '@/utils/request'

export function testTaskList(query) {
  return request({
    url: '/exam/task/list',
    method: 'get',
    params: query
  })
}

export function testTaskInfo(id) {
  return request({
    url: `/exam/task/info/${id}`,
    method: 'get'
  })
}

export function testTaskDelete(id) {
  return request({
    url: '/exam/task/' + id,
    method: 'delete'
  })
}

export function testTaskSubmit(data) {
  return request({
    url: '/exam/task/submit',
    method: 'post',
    data
  })
}

export function testTaskRectify(data) {
  return request({
    url: '/exam/task/rectify',
    method: 'post',
    data
  })
}

export function getNow() {
  return request({
    url: '/exam/task/getNow',
    method: 'get'
  })
}

export function taskAdd(params) {
  return request({
    url: `/exam/task/add`,
    method: 'get',
    params
  })
}

export function startExamCheck(taskId) {
  return request({
    url: `/userTrainPlan/startExamCheck/${taskId}`,
    method: 'get'
  })
}

export function recycleExam(taskId) {
  return request({
    url: `/exam/task/recycle/${taskId}`,
    method: 'get'
  })
}

export function historyList(taskId) {
  return request({
    url: `/exam/task/history/${taskId}`,
    method: 'get'
  })
}
